package com.fenghongzhang.module_main.splash

import MallBanner
import androidx.lifecycle.viewModelScope
import com.fenghongzhang.lib_core.base.BaseViewModel
import com.fenghongzhang.module_main.model.CommonSimpleBody
import com.fenghongzhang.module_main.repository.MallRepository
import dagger.hilt.android.AndroidEntryPoint


import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject


@HiltViewModel
class SplashViewModel @Inject constructor(
    private val mRepository: MallRepository

) : BaseViewModel() {
    var mAppStartAdInfo: MallBanner? = null

    fun cMallAdInfo(adType: String) {
        executeOpenApi(action = mRepository.cmallAdInfo(CommonSimpleBody(adType = adType)),
            onFinished = {
                mAppStartAdInfo = it.mallAdInfo?.firstOrNull()
            })
    }
}